package com.yx.front.enums;

/**
 * @author YangXiong
 */
public enum CommentsType {
    TO_USER(1, "对人评论"),
    TO_APP(2, "对应用评论"),
    TO_SOURCE(3, "对资源评论"),
    ;
    private final Integer key;
    private final String value;

    CommentsType(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public Integer getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public static String getValueByKey(Integer key) {
        for (CommentsType keyword : CommentsType.values()) {
            if (keyword.getKey().equals(key)) {
                return keyword.getValue();
            }
        }
        return "";
    }
}
